<template>
	<view class="collectinfo-container">
		
		<!-- 面试题 -->
		<view class="collectinfo-feed" v-if="info.tag == '面试题'">
			<view class="collectinfo-top">
				<view>
					题目：{{info.title}}
				</view>
				<view class="collectinfo-uploadtime">
					更新时间：{{info.updtime}}
				</view>
			</view>
			<!-- 底部按钮 -->
			<info-btn :coltype="info.coltype" :data="info"></info-btn>
		</view>

		<!-- 笔试题 -->
		<view class="collectinfo-write" v-else>
			<view class="collectinfo-top">
				<view>
					题目：{{info.title}}
				</view>
				<view class="collectinfo-uploadtime">
					更新时间：{{info.updtime}}
				</view>
			</view>
			<!-- 底部按钮 -->
			<info-btn :coltype="info.coltype" :data="info"></info-btn>
		</view>

	</view>
</template>

<script>
	import InfoBtn from "@/components/infobtn.vue"
	export default {
		components: {
			InfoBtn
		},
		data() {
			return {
				info: {
					answer: "",
					coltime: "",
					coltype: 1, // 1代表已收藏, 0代表未收藏
					id: 0,
					tag: "",
					title: "",
					updtime: ""
				}
			};
		},
		onLoad(params) {
			this.info = JSON.parse(decodeURIComponent(params.data));
			uni.setNavigationBarTitle({
				title: this.info.tag
			})
		},
	}
</script>

<style lang="scss">
	.collectinfo-container {
		width: 100vw;
		height: 100vh;
		line-height: 48rpx;
		position: relative;

		.collectinfo-top {
			padding: 20rpx;

			.collectinfo-uploadtime {
				font-size: 30rpx;
				color: #3b3b3b;
			}
		}
	}
</style>
